$(document).ready(function() {
	$(".bnt_frm").click(function() {
		var card_no = $("#card_no").val();
        var password = $("#password").val();
        var oldpassword = $("#oldpassword").val();
        var newpassword = $("#newpassword").val();
        if (card_no =="") {
        	jAlert("请填写卡号","修改失败","");
        	return false;
        }else if(oldpassword ==""){
            jAlert("请填写旧密码","修改失败","");
            return false;
        }else if(newpassword ==""){
            jAlert("请填写新密码","修改失败","");
            return false;
        }else if(newpassword !=password){
            jAlert("两次填写的密码不一致","修改失败","");
            return false;
        }
		$.ajax({
            url: "index.php?go=softpos.api.ajaxXgmm",
            type: 'post',
            dataType: 'json',
            data:$("#frm").serialize(),
            success: function(response) {
                if (response.success == "success") {
                    jAlert(response.data,"修改成功",function(r) {
                        if (r==true) {
                            location.reload();
                        }
                    });
                } else {
                    jAlert(response.data,"修改失败","");
                }
            }
        });
	});
});